
<template>
	<div class="card m5 p10 flex_col" style="width: 150px;" @click="onClickSelect">
		<div class="flex_row_center">
			<label>设备名称:</label>
			<label>{{ props.device.name }}</label>
		</div>
		<div class="flex_row_center">
			<label>设备ID:</label>
			<label>{{ props.device.id }}</label>
		</div>
	</div>
</template>


<script setup lang="ts">

import type { Device } from '@/service/model';
import { selectDevice } from '@/service/react';

interface Props {
	device: Device,
}

const props = defineProps<Props>();

function onClickSelect() {
	selectDevice.value = props.device;
}

</script>